<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>ES6中的Proxy</h2>
</body>
<script>
    let obj={}
    const p=new Proxy(obj,{
        //获取
        get(target,key,receiver){
            console.log('获取的属性:',key)
            return target[key]
        },
        //设置
        set(target,key,value,receiver) {
            console.log('设置的值的属性:',value)
            target[key]=value;
        }
    })

   
</script>
</html>